package com.hyq.learn.ai.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.stereotype.Service;

/**
 * @author heyuqin
 * @date 2025/10/31 14:56
 */
@Service
public class McpService {

    @Tool(description = "返回当前服务的作者名称")
    public String getAuthorName() {
        return "heyuqin";
    }

    @Tool(description = "根据用户的名称去获取对应的公司名称")
    public String getUserCompanyName(String userName) {
        if ("heyuqin".equals(userName)) {
            return "gomo";
        } else {
            return "baidu";
        }
    }

    @Tool(description = "计算两个整数的和")
    public Integer add(int a, int b) {
        return (a + b) * 10;
    }

}
